<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');?>
<div class="mainBody">
    <div class="btnArea floatFix">
        <div class="selectorDiv">
            <div class="selectorName fontDinpro">OS</div>
            <div class="locationGroup listGroupDown listGroup">
                <a class="btnLeft btnPrimary fontDinpro" data-toggle="dropdown" href="javascript:void(0)" link="">
                    <?php
                    switch($cur_os){
                        case "":
                            echo "All";
                            break;
                        default:
                            echo $os[$cur_os];
                    }
                    ?>
                </a>
                <a class="btnRight btnPrimary" data-toggle="dropdown" href="javascript:void(0)"><span class="caretBottom"></span></a>
                <ul class="dropDownList fontDinpro">
                    <li>
                        <a href="javascript:void(0)" class="fontDinpro" link="<?php echo backend_url($language.'/param/view/chtype/'.$cur_chtype.'/os'); ?>/">
                            All
                        </a>
                    </li>
                    <?php foreach($os as $k=>$r): ?>
                        <li>
                            <a href="javascript:void(0)" class="fontDinpro" link="<?php echo backend_url($language.'/param/view/chtype/'.$cur_chtype.'/os'); ?>/<?php echo $k; ?>">
                                <?php echo $r; ?>
                            </a>
                        </li>
                    <?php endforeach; ?>
                </ul>
            </div>
        </div>
    </div>
    <div class="tableContent">
        <table class="fontDinpro">
            <thead>
            <tr>
                <th style="width: 100px;">Channel Code</th>
                <th style="width: 120px;">Channel Name</th>
                <th style="width: 80px;">OS</th>
                <th style="width: 120px;">GROUP</th>
                <th>Params</th>
                <th style="width: 80px;">Icon force</th>
                <th style="width: 100px;">Options</th>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td style="width: 100px;">Channel Code</td>
                <td style="width: 120px;">Channel Name</td>
                <td style="width: 80px;">OS</td>
                <td style="width: 120px;">GROUP</td>
                <td>Params</td>
                <td style="width: 80px;">Icon force</td>
                <td style="width: 100px;">Options</td>
            </tr>
            <?php foreach($list as $v) : ?>
                <tr class="lowTr">
                    <td><?php echo $v['chcode']; ?></td>
                    <td><?php echo $v['cname']; ?></td>
                    <td>
                        <?php
                        $className = '';
                        switch($os[$v['os']]){
                            case "ios":
                                $className = "";
                                break;
                            case "android":
                                $className = "bgAndroidGreen";
                                break;
                            case "wp":
                                $className = "bgBlue";
                                break;
                        }
                        ?>
                        <span class="colorLabel <?php echo $className; ?>"><?php echo $os[$v['os']]; ?></span>
                    </td>
                    <td><?php if(isset($params[$v['chcode'].'_group'])){
                    	echo '<span class="colorLabel bgBlue">'.$chcode_group_names[$params[$v['chcode'].'_group']].'</span>';
                    }
                    	else{
							echo '<span class="colorLabel">未设置</span>';
						}?></td>
                    <td>
                    	<?php
                    			if(isset($params[$v['chcode']])){
									echo  sub_utf_string($params[$v['chcode']],24);
								}else{
									echo '<span class="colorLabel">未设置</span>';
								}
                    	?>
                    </td>
                    <td>
                    	<?php if(!isset($params[$v['chcode'].'_icon'])):?>
								<span class="colorLabel"> 未设置</span>
						<?php elseif($params[$v['chcode'].'_icon'] == 0):?>
								<span class="colorLabel bgBlue">无</span>
						<?php else:?>
								<span class="colorLabel bgAndroidGreen">有</span>
                    	<?php endif;?>
                    </td>
                    <td>
                        <button class="tableBtn" onclick="location.href='<?php echo backend_url('param/edit/'.$v['chcode']); ?>'">
                        	<div class="editIcon"></div>Edit
                    	</button>
                    </td>
                </tr>
            <?php endforeach; ?>
            <tr style="height: 33px;"></tr>
            </tbody>
        </table>
    </div>
    <div class="changePage"><?php echo $pagination; ?></div>
</div>
